1. Field of the Invention
The present invention relates to a three-dimensional shape measurement photographing apparatus and method for obtaining a measurement image for measuring a three-dimensional shape of a subject. The invention also relates to a computer recording medium on which is recorded a program for causing a computer to perform the three-dimensional shape measurement photographing method.
2. Description of the Related Art
In distance measurement methods generally called as stereo methods or three-dimensional image measurement methods, a subject is photographed using at least two cameras (one base camera and the other reference camera) placed at different positions, then pixel matching is performed between a plurality of obtained measurement images (base image obtained by the base camera and reference image obtained by the reference camera), and the principle of triangulation is applied to the positional difference (parallax) between a pixel on the base image and a pixel on the reference image related to each other, whereby the distance from the base or reference camera to the point on the subject corresponding to the pixel is measured.
Therefore, if the distances to all pixels corresponding to the entire surface of a subject are measured, a three-dimensional shape of the subject such as the shape, depth, and the like may be obtained. It is also possible to measure a three-dimensional shape of a subject with a single camera by photographing the subject at different positions and obtaining a plurality of images.
In the stereo method, as illustrated in FIG. 20, pixel matching is performed based on the fact that there exists a plurality of points in real space which are mapped to a certain pixel Pa of base image G1, such as points P1, P2, P3, and the like along a visual line from point C, and point Pa′ of reference image G2 corresponding to point Pa exists on a straight line (epipolar line) representing mapped images of points P1, P2, P3, and the like. In FIG. 20, point C is a viewpoint of the base camera and point C′ is a viewpoint of the reference camera.
The stereo method, however, has a problem that when a subject does not have any local characteristic like, for example, human face contrast, shape, color or the like, corresponding points can not be obtained by pixel matching. In order to solve the problem, a method in which pattern light, such as random dot pattern, grid pattern, barcode pattern, or the like is emitted on a subject and corresponding points are obtained based on the position of the pattern light is proposed as described, for example, in U.S. Patent Application Publication No. 20050007487 and Japanese Unexamined Patent Publication No. 2000-283752.
Further, a method that measures the contrast of a subject and determines whether to emit pattern light based on measurement results is also proposed as described, for example, in Japanese Unexamined Patent Publication No. 2002-300605.
The method described in Japanese Unexamined Patent Publication No. 2002-300605, however, determines whether to emit pattern light over the entire range of the angle of view, so that the pattern light is emitted even to a portion having a high contrast or a local characteristic included in the angle of view. Illumination of the pattern light on such a portion having a high contrast or a local characteristic will result in a larger amount of high frequency component in the obtained image. Consequently, a moiré is generated in the image corresponding to the portion and appropriate searching for corresponding points is prevented, thereby causing a problem that an accurate distance measurement to the subject can not be performed.